package com.demo.dao.impl;

import com.demo.dao.UserDao;
import com.demo.pojo.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Map;
@Scope("singleton")
@Repository("userDao")
public class UserDaoImpl implements UserDao {
    @Value("123123123")
    private String str;

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    @PostConstruct
    public void myInitMethod() {
        System.out.println("必要的初始化步骤");
    }

    @PreDestroy
    public void myDestroyMethod() {
        System.out.println("必要的销毁步骤");
    }

    @Override
    public void save() {
        System.out.println("UserDaoImpl正在执行，用户已保存");
    }
}
